//
//  GCMTaskListTableViewCell.m
//  GeeCityManager
//
//  Created by 聚城科技 on 16/3/22.
//  Copyright © 2016年 聚城科技. All rights reserved.
//

#import "GCMTaskListTableViewCell.h"

@implementation GCMTaskListTableViewCell{
    
    UIView * _bgView;
    UILabel *_titleLabel;
    UILabel *_detailLabel;
    UILabel *_MSLabel;
    UILabel *_SJLabel;
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createUI];
    }
    return self;
}

-(void)createUI{
    
    _bgView = [[UIImageView alloc]init];
    _bgView.frame =CGRectMake(10, 10,SCREEN_WIDTH - 20, 100);
    _bgView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:_bgView];
    
    _titleLabel = [[UILabel alloc]init];
    _titleLabel.frame = CGRectMake(0,0,_bgView.bounds.size.width, 30);
    //_titleLabel.font = [UIFont systemFontOfSize:15];
    //    _titleLabel.textColor = [UIColor lightGrayColor];
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    [_bgView addSubview:_titleLabel];
    
    _detailLabel = [[UILabel alloc]init];
    _detailLabel.frame = CGRectMake(20 ,30 , _bgView.bounds.size.width - 40, 20);
    _detailLabel.font = [UIFont systemFontOfSize:14];
    _detailLabel.textColor = [UIColor colorWithRed:0.58 green:0.65 blue:0.65 alpha:1.00];
    _detailLabel.textAlignment = NSTextAlignmentLeft;
    [_bgView addSubview:_detailLabel];
    
    _MSLabel = [[UILabel alloc]init];
    _MSLabel.frame = CGRectMake(20,50, _bgView.bounds.size.width - 40,20 );
    _MSLabel.font = [UIFont systemFontOfSize:14];
    _MSLabel.textAlignment = NSTextAlignmentLeft;
    _MSLabel.textColor = [UIColor colorWithRed:0.58 green:0.65 blue:0.65 alpha:1.00];
    [_bgView addSubview:_MSLabel];
    
    _SJLabel= [[UILabel alloc]init];
    _SJLabel.frame = CGRectMake(20,70, _bgView.bounds.size.width - 40,20 );
    _SJLabel.font = [UIFont systemFontOfSize:14];
    _SJLabel.textAlignment = NSTextAlignmentLeft;
    _SJLabel.textColor = [UIColor colorWithRed:0.58 green:0.65 blue:0.65 alpha:1.00];
    [_bgView addSubview:_SJLabel];

}

-(void)setListModel:(GCMTaskListModel *)listMode{
    
    _listModel = listMode;
    _titleLabel.text = [NSString stringWithFormat:@"[%@]",_listModel.state];
    _detailLabel.text = [NSString stringWithFormat:@"%@   %@",_listModel.room,_listModel.title];
    _MSLabel.text = [NSString stringWithFormat:@"任务描述 ： %@",_listModel.contact];
    _SJLabel.text = [NSString stringWithFormat:@"受理时间 ： %@",_listModel.time];
    
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
